package com.micmac.main.view.compenents
{
	import com.micmac.customer.events.CustomerEvent;
	import com.micmac.main.events.ModuleLoadEvent;
	
	import flash.events.Event;
	
	import mx.controls.Alert;
	
	import org.robotlegs.utilities.modular.mvcs.ModuleMediator;
	
	public class LeftPanelViewMediator extends ModuleMediator
	{
		[Inject]
		public var leftPanelView:LeftPanelView;
		
		private static const CUSTOMER_SWF_PATH:String = 'com/micmac/customer/view/CustomerPageView.swf';
		private static const ACCOUNT_SWF_PATH:String = 'com/micmac/account/view/MainAccountPage.swf';
		
		override public function onRegister():void
		{
			addViewListener(LeftPanelView.ON_LOAD_CUSTOMER,onLoadCustomer);
			addViewListener(LeftPanelView.ON_LOAD_ACCOUNT,onLoadAccount)
		}
		
		private function onLoadCustomer(event:Event):void
		{
			dispatch(new ModuleLoadEvent(ModuleLoadEvent.LOAD_MODULE,CUSTOMER_SWF_PATH));
		}
		
		private function onLoadAccount(event:Event):void
		{
			dispatch(new ModuleLoadEvent(ModuleLoadEvent.LOAD_MODULE,ACCOUNT_SWF_PATH));
		}
	}
}